package com.duguyuan.service;

import java.lang.reflect.Proxy;

public class ProxyUserService {

    private static UserService subject = new UserServiceImpl();

    private ProxyUserService() {}

    public static UserService getProxyUserService() {
        return (UserService) Proxy.newProxyInstance(subject.getClass().getClassLoader(), subject.getClass().getInterfaces(),new MyInvocationHandler(subject));
    }

}
